#region "ResourcesExceptionWrapper"

/*
 * ####     Developer Name : Wang Yucai
 * 
 * ####     Development Tool : Microsoft VisualStudio 2010 Ultimate Edition
 * 
 * ####     Create Time : 2014/7/8 9:36:42
 * 
 * ####     Namespace : Masterduner.SourceStudio.Practices.DevelopmentLibrary.Resources
 * 
 * ####     Type Name : ResourcesExceptionWrapper
 * 
 * ####     Full Name : Masterduner.SourceStudio.Practices.DevelopmentLibrary.Resources.ResourcesExceptionWrapper
 * 
 * ####     Machine Name : GLCHQWYCWINW7
 * 
 * ####     UserName : GUOCOLAND/wangyucai
 * 
 * ####     CLR Version : 4.0.30319.18408
 * 
 * ####     Target Framework Version : 4.0
 */

#endregion

using System;
using System.Reflection;

namespace Masterduner.SourceStudio.Practices.DevelopmentLibrary.Resources
{
    /// <summary>
    /// <para>Masterduner.SourceStudio.Practices.DevelopmentLibrary.Resources.ResourcesExceptionWrapper</para>
    /// <para>
    /// 检索资源清单时抛出此异常。
    /// </para>
    /// </summary>
    /// <remarks>
    /// <para>Target Framework Version : 4.0</para>
    /// <para>此类不可继承。</para>
    /// </remarks>
    [Serializable]
    public sealed class ResourcesExceptionWrapper : ExceptionWrapper
    {
        private Assembly _includeResourceAssembly;
        private string _baseName;
        private string _name;

        #region IncludeResourceAssembly
        /// <summary>
        /// 获取包含资源的<see cref="Assembly"/>对象实例。
        /// </summary>
        public Assembly IncludeResourceAssembly
        {
            get { return _includeResourceAssembly; }
            private set { _includeResourceAssembly = value; }
        }
        #endregion

        #region BaseName
        /// <summary>
        /// 获取资源的基础名称。
        /// </summary>
        public string BaseName
        {
            get { return _baseName; }
            private set { _baseName = value; }
        }
        #endregion

        #region Name
        /// <summary>
        /// 获取资源名称。
        /// </summary>
        public string Name
        {
            get { return _name; }
            private set { _name = value; }
        }
        #endregion

        #region Constructor

        /// <summary>
        /// <para>构造函数：</para>
        /// <para>初始化一个<see cref="ResourcesExceptionWrapper" />对象实例。</para>
        /// </summary>
        /// <param name="includeResourceAssembly">包含资源的<see cref="Assembly"/>对象实例。</param>
        /// <param name="baseName">资源的基础名称。</param>
        /// <param name="resourceName">资源名称。</param>
        /// <param name="innerException">引发此异常的<see cref="Exception"/>对象实例。</param>
        public ResourcesExceptionWrapper(Assembly includeResourceAssembly, string baseName, string resourceName, Exception innerException)
            : base(
                "MDSS::DEVLIB::00000007",
                string.Format("{0}({1})", ExceptionMessageCollections.ResourcesException, string.Format(ExceptionDescriptionCollections.ResourceDescription, includeResourceAssembly.FullName, baseName, resourceName)),
                innerException
            )
        {
            this.IncludeResourceAssembly = includeResourceAssembly;
            this.BaseName = baseName;
            this.Name = resourceName;
        }

        /// <summary>
        /// <para>构造函数：</para>
        /// <para>初始化一个<see cref="ResourcesExceptionWrapper" />对象实例。</para>
        /// </summary>
        /// <param name="includeResourceAssembly">包含资源的<see cref="Assembly"/>对象实例。</param>
        /// <param name="baseName">资源的基础名称。</param>
        /// <param name="resourceName">资源名称。</param>
        public ResourcesExceptionWrapper(Assembly includeResourceAssembly, string baseName, string resourceName)
            : this(includeResourceAssembly, baseName, resourceName, null)
        {
        }

        #endregion
    }
}

#region README

/*
 * ####     ©2014 Wang Yucai
 * 
 * ####     Contact me
 *                  
 *                  E-mail : Masterduner@Yeah.net
 *                  Mobile : 13621384677
 *                  QQ : 180261899
 */

#endregion